#include <iostream>

using namespace std;

/*
 *  关系运算符重载
 */

class Person{
public:
    int p_a;
    string p_b;
    Person(int a, string b){
        p_a = a;
        p_b = b;
    }
    bool operator== (Person &p){
        if(this->p_a == p.p_a && this->p_b == p.p_b){
            return true;
        } else{
            return false;
        }
    }
    bool operator!= (Person &p){
        if(this->p_a == p.p_a && this->p_b == p.p_b) {
            return false;
        } else{
            return true;
        }
    }
};

void test(){
    Person p1(1, "a");
    Person p2(2, "a");
    if(p1 == p2){
        cout << "相等" << endl;
    } else{
        cout << "不相等" << endl;
    }
    if(p1 != p2){
        cout << "不相等" << endl;
    }
}

int main() {
    test();

    return 0;
}
